import 'package:flutter/material.dart';
import 'package:framelib/widgets/loading_dialog.dart';
import 'package:get/get.dart';

/**
 * 加载过渡工具类
 */
class LoadUtil{
  static showLoad({String? loadingText,bool? canceledOnTouchOutside}){
    Get.dialog(LoadingDialog(canceledOnTouchOutside??true,loadingText: loadingText??'loading...',));
  }
  static hideLoad({BuildContext? context}){
    if( Navigator.of(context??(Get.context!)).canPop()){
      Navigator.of(context??(Get.context!)).pop();
    }
  }
}